<%--
  Created by IntelliJ IDEA.
  User: HAN
  Date: 2020/12/3
  Time: 14:55
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/layui/css/layui.css">
    <script src="${pageContext.request.contextPath}/layui/layui.js"></script>
</head>
<body>
<table class="layui-hide" id="demo" lay-filter="test"></table>

<script>
    layui.use(['table','layer'], function() {
        var table = layui.table;
        var layer = layui.layer;
        var $ = layui.jquery;
        table.render({
            elem: '#demo ' //id为test的table
            ,url:'${pageContext.request.contextPath}/tongji'   //url 查询数据   所有的客户的数据
           // ,toolbar: '#toolbarDemo' //开启头部工具栏，并为其绑定左侧模板
            ,defaultToolbar: []
            ,title: '角色表'
            //data[{ id:12,name:123}]
            ,cols: [[
                {field:'name', title:'ID',fixed: 'left',  sort: true}
                ,{field:'price', title:'角色名字'}
                ,{field:'month', title:'角色名字'}
                // ,{field:'email', title:'邮箱', width:150, edit: 'text', templet: function(res){
                //         return '<em>'+ res.email +'</em>'
                //     }}

                ,{fixed: 'right', title:'操作', toolbar: '#barDemo'}

            ]]
            ,page: true
        });

    });
</script>
</body>
</html>
